<?php
define( '_ACCESS', 'PUBLIC' );// or die( 'Direct Access to this location is not allowed.' );
define('_LOCATION', 'WWW');
global $db, $item, $id, $option;
session_start();
require_once('configuration.php');
require_once('includes/DbConnector.php');
$db = new DbConnector();
/*=================*/
$db->dbg = true;
/*=================*/
$location=$db->getSetting('_absolute_path');
$Lang = $db->getSetting('Lang');
if (!$Lang) require_once($location."/lang/EN.php"); else require_once($location."/lang/$Lang.php");
require_once($_absolute_path.'includes/kernel.php');
mainFunc();
$Filial_name = "";
if ($db->getSetting('access'))
{
	$Lang = $db->getSetting('Lang');
	$Filial_id = $db->getSetting('Filial_id');
	
	$res=$db->query("SELECT $Lang AS trans
					FROM Translation INNER JOIN FilialList
											ON Translation.id = FilialList.translation_link
					WHERE     (FilialList.id = $Filial_id) LIMIT 1");
	$cur_fil = $db->fetchObject($res);
	if ($cur_fil) $Filial_name = $cur_fil->trans; 
}
echo '<?xml version="1.0" encoding="utf-8"?>';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--link href="<?php echo $db->getSetting('_live_site');?>style/style.css" rel="stylesheet" type="text/css" media="all" /-->
<link href="<?php echo $db->getSetting('_live_site');?>style/styleKnauf.css" rel="stylesheet" type="text/css" media="all" />
<title><?php echo $db->getSetting('_site_name');?></title>
<script language="JAVASCRIPT" src="<?php echo $db->getSetting('_live_site'); ?>admin/js/calendar.js" type="text/javascript"></script>
<script language="JAVASCRIPT" src="<?php echo $db->getSetting('_live_site'); ?>admin/js/my_mini.js" type="text/javascript"></script>


</head>
<body>
<div id="logo">
	<a class=pegehead href="<?php echo $db->getSetting('_live_site');?>"><?php //echo $db->getSetting('_site_name');?></a>
</div>
<div id="righttopcorner"></div>
<div id="filial"><?php echo $Filial_name;?></div>
<div class="breakline"></div>
<?php
loginFromOut();
LangsOut();
if ($db->getSetting('access')) DatesOut();
?>
<div class="breakline"></div>
<?php
menuOut();
require_once($location."main.php");
?>	      



</body>
</html>